﻿@extends('/home/layout/layout')@section('tittle', '我的收藏')
@section('css')
<link rel="stylesheet" type="text/css" href="{{asset('/HomeCss/css/common.css')}}"/>
<link rel="stylesheet" type="text/css" href="{{asset('/HomeCss/css/ucenter.css')}}">
<script type="text/javascript" src="{{asset('/HomeCss/js/jquery.js')}}"></script>
@endsection
@section('con')
<div class="ucenter">
    <!--加载menu-->
    <div class="leftnnav">
    <dl>
        <dt>订单中心</dt>
        <dd><a href="/order/lists" title="我的订单">我的订单</a></dd>
        <dd><a href="/order/lists/c" title="评价晒单">评价晒单</a></dd>
    </dl>
    <dl>
        <dt>个人中心</dt>
        <dd><a href="/installment/index" title="我的好乐买分期">我的好乐买分期</a></dd>
        <dd><a href="{{asset('/home/collect/index')}}" title="我的收藏" class="cur">我的收藏</a></dd>
        <dd><a href="/member/mycoupon" title="我的优惠券">我的优惠券</a></dd>
        <dd><a href="/member/integral" title="我的积分">我的积分</a></dd>
        <dd><a href="/memberaddress/address" title="收货地址管理">收货地址管理</a></dd>
        <dd><a href="/member/realname_identify" title="实名认证">实名认证</a></dd>
                    <dd><a href="{{asset('/home/umessage/index')}}" title="账号安全">账号安全</a></dd>
                <dd><a href="/inbox/index" title="我的消息">我的消息</a></dd>
    </dl>
    <dl>
        <dt>客户服务</dt>
        <dd><a href="{{asset('/home/umessage/member')}}" title="用户反馈">用户反馈</a></dd>
        <dd><a href="{{asset('/home/umessage/liuyan')}}" title="查看反馈">查看反馈</a></dd>
    </dl>
</div>    <div class="rMain" style="min-height:599px;overflow:visible;">
        <div class="rmainTitle">
            <h3>我的收藏</h3>
                    </div>
        <div id="wishshow">
            <form action="/wish/batch_del_fav" name="delFavorite" method="POST">
                <div id="newishTab" class="clearfix">
                    @foreach($collect as $k=>$v)
                    <div class="collegood"> 
                        <div class="coframe" comid="17322661"> 
                            <a title="{{$v->gname}}" href="{{asset('/goods/index?id='.$v->gid)}}" target="_blank">
                                <img src="{{$v->gpic}}">
                            </a>
                            <b data-id="{{$v->gid}}" class="colremove" style="display: none;"></b>
                             <!-- 售罄 -->
                            <div id="confirmDiv" style="right: -80px; top: 35px; position: absolute;display:none;">
                                <p class="msg">确定要删除该商品么？</p>
                                <span class="arrow" style="top:-13px;left:43px;"><i class="a1">◆</i><i class="a2">◆</i></span>
                                <p class="ops"><span class="ok">确定</span> | <span class="cancel">取消</span></p>
                            </div>
                        </div>
                        <a class="collename" href="/product/detail/17322661.html" target="_blank" title="{{$v->gbrand}}">{{$v->gname}}</a>
                        <span class="colleprice">￥{{$v->zkprice}}</span>
                    </div>
                    @endforeach
                </div><!-- cohover -->
                <script type="text/javascript">
                     //移入事件
                        $('.coframe').mouseover(function(){
                        $(this).attr('class','coframe cohover');
                        $(this).find('b').css('display','inline');
                    })
                    //移出事件
                    $('.coframe').mouseout(function(){
                        $(this).attr('class','coframe');
                        $(this).find('b').css('display','none');
                    })
                    //删除的单击事件
                    $('.colremove').click(function(){
                        for (var i = 0; i <  $('.collegood').length; i++) {
                             $('.collegood').eq(i).find('#confirmDiv').css('display','none');
                        };
                        $(this).next().css('display','block');
                        $(this).next().delay(4000).fadeOut(1000);
                    })
                    //取消的单击事件
                    $('.cancel').click(function(){
                        $(this).parents('#confirmDiv').css('display','none');
                    })
                    //确定的单击事件
                    $('.ok').click(function(){
                        //获取商品id
                        var ok = $(this);
                        var gid = $(this).parents('#confirmDiv').prev().attr('data-id');
                        console.log(gid);
                        $.get("{{asset('/collect/del')}}",{gid:gid},function(data){
                            if(data==1){
                                //删除样式
                                ok.parents('.collegood').remove();
                            }else{
                                alert('已删除');
                            }
                        });
                    })
                </script>
            </form>
        </div>
        <div class="prolist-page"><span class="propage-num"></span></div> 
            

            </div> 
    <div class="OB_clearB"></div>
    <div id="dialog"></div>
</div>
@endsection

@section('js')
<script type="text/javascript" src="{{asset('/HomeCss/js/jquery-confirmmini.js')}}"></script>
<script type="text/javascript" src="{{asset('/HomeCss/js/jquery.topsuggest.js')}}"></script>
<script type="text/javascript" src="{{asset('/HomeCss/js/jquery-confirm-favorite.js')}}"></script>
<script type="text/javascript" src="{{asset('/HomeCss/js/traffic.js')}}" async></script>
@endsection